package com.wbt.design.patterns.obverser.test02;

/**
 * @program: spring
 * @description:
 * @author: Wang·Baotong
 * @create: 2021-07-05 14:46
 */
public class ObserverPatternDemo {

    public static void main(String[] args) {
        Subject subject = new ConcreteSubject();

        Observer aa = new OctalObserver(subject);
        new BinaryObserver(subject);

        System.out.println("First state change: 15");
        subject.setState(15);
        subject.notifyObserver();
        System.out.println("=====================================================");
        System.out.println("Second state change: 10");
        subject.setState(10);
        subject.remove(aa);
        subject.notifyObserver();
    }
}
